package com.cloud.alarm.dinger.core.entity;

import lombok.Getter;

/**
 * DingerMethod
 *
 * @author shuai.zhou
 * @version 1.0
 */
@Getter
public class DingerMethod {

    String methodName;

    String[] methodParams;

    int[] paramTypes;

    public DingerMethod(String methodName, String[] methodParams, int[] paramTypes) {
        this.methodName = methodName;
        this.methodParams = methodParams;
        this.paramTypes = paramTypes;
    }

    public boolean check() {
        if (paramTypes == null) {
            return false;
        }

        int length = this.methodParams.length;
        for (int index : paramTypes) {
            if (index >= length) {
                return true;
            }
        }
        return false;
    }

}